<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";   
session.invalidate();
%>
<!doctype html>
<html lang="en">
<head>
	<base href="<%=basePath%>">
	<meta charset="UTF-8">
	<title>环球数码后台登录</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
	<link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script src="./js/x-layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>

</head>
<body class="login-bg">
    
    <div class="login">
        <div class="message">环球数码-管理登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="phone" id="loginname" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" id="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
        </form>
             <hr class="hr15">
            <input value="登录" onclick="severCheck();" style="width:100%;" type="submit">
            <hr class="hr20" >
    </div>

    <script>
    function severCheck1(){
    		var admin = $("#loginname").val();
    		var password = $("#password").val();
    		 var  data = {"phone":admin,"password":password};  
    		 
    		 $.ajax({
	             type: "post",
	             url: "sysUser/loginUser",
	             data: JSON.stringify(data),
   	             contentType:"application/json;charset=UTF-8", 
   	             dataType:"json",
   	             success: function(data){    
   	            	if(data.code==200){
   	            		location.href ='<%=basePath%>'+"index.jsp";  
   	 	       		}else{
   	 	    	      	var txt=data.msg;
	   	 	    		layer.alert(txt, {icon: 6},function () {
	   	 	    		location.reload();
 	 	                });  
 	 	      	     }
   	             }
	         });  
    	}
    
    function severCheck(){
    		var admin = $("#loginname").val();
    		var password = $("#password").val();
    		 var  data = {"phone":admin,"password":password};  
    		 
    		 $.ajax({
	             type: "post",
	             url: "role/loginUser",
	             data: JSON.stringify(data),
   	             contentType:"application/json;charset=UTF-8", 
   	             dataType:"json",
   	             success: function(data){
   	            	console.log(data.msg);
   	            	if(data.code==200){
   	            		location.href ='<%=basePath%>'+"index.jsp";  
   	 	       		}else{
   	 	    	      	var txt=data.msg;
	   	 	    		layer.alert(txt, {icon: 6},function () {
	   	 	    		location.reload();
 	 	                });  
 	 	      	     }
   	             }
	         });  
    	}
    
    layui.use(['form','layer','upload'], function(){
        $ = layui.jquery;
      var form = layui.form()
      ,layer = layui.layer;
      });
    
  //客户端校验
	/* function check() {

		if ($("#loginname").val() == "") {

			$("#loginname").tips({
				side : 2,
				msg : '用户名不得为空',
				bg : '#AE81FF',
				time : 3
			});

			$("#loginname").focus();
			return false;
		} else {
			$("#loginname").val(jQuery.trim($('#loginname').val()));
		}

		if ($("#password").val() == "") {

			$("#password").tips({
				side : 2,
				msg : '密码不得为空',
				bg : '#AE81FF',
				time : 3
			});

			$("#password").focus();
			return false;
		}
		
		$("#loginbox").tips({
			side : 1,
			msg : '正在登录 , 请稍后 ...',
			bg : '#68B500',
			time : 10
		});

		return true;
  } */
        
    </script>

    
    <!-- 底部结束 -->
